
#ifndef __UI__H__
#define __UI__H__

#ifdef _WIN32
#include <conio.h>
#else
#define getch() getchar()
#endif

#ifdef _WIN32
#define CLEAR "cls"
#else
#define CLEAR "clear"
#endif

class UI {
public:
    virtual void SystemOut( const char * stOutString ) = 0;
	virtual void SystemHint ( const char * stHintString ) = 0;
	virtual void SystemWarning(const char * stWarningString) = 0;
	virtual void SystemPause() = 0;	

    static UI * GetUI();
    static void DestroyUI();

    short GetUserInput(short nMin, short nMax );

protected:
    short GetUserInput();
private:
    static UI * instance;
};

class TextUI : public UI {
public:
    TextUI();
    virtual void SystemOut( const char * stOutString );
	virtual void SystemHint ( const char * stHintString );
	virtual void SystemWarning(const char * stWarningString);
	virtual void SystemPause();
};

class GraphicUI: public UI {
public:
    virtual void SystemOut( const char * stOutString );
	virtual void SystemHint ( const char * stHintString );
	virtual void SystemWarning(const char * stWarningString);
	virtual void SystemPause();
};

#endif
